home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tpmemo.zip / ENTRY.TXT < prev    next >
Text File  |  1993-01-04  |  18KB  |  501 lines

  1. ; Set width of help screen
  2. !WIDTH 66
  3. ;
  4. ; The first seventeen topics pertain to the data entry fields
  5. ;
  6. !TOPIC  1 Name field
  7. This field has no special characteristics of its own. Like the
  8. other fields in the program, however, the field is cleared
  9. if the first character pressed is an ASCII character, an option
  10. activated with SetClearFirstChar(On). No special validation of
  11. input is performed on this field.
  12. ;
  13. !TOPIC  2 Address field
  14. This field has only one special characteristic: it is marked as a
  15. required field, meaning that it cannot be left blank. The screen
  16. editor will check its contents both when leaving the field and
  17. when exiting from the screen editor (unless <Esc> has been pressed,
  18. a user-defined exit command has been issued, or the data entry
  19. screen is being exited temporarily in order to process a nested
  20. entry screen such as the one associated with the 6Phones field).
  21. ;
  22. !TOPIC  3 City field
  23. This field has only one special characteristic: inserting new text
  24. cannot cause existing text to be pushed off the end of the field,
  25. an option selected with SetInsertPushes(Off). No special
  26. validation of input is performed on this field.
  27. ;
  28. !TOPIC  4 State field
  29. In terms of field editing options, this field has no special
  30. characteristics, but it differs from the other fields in that a
  31. user-defined exit key, <F2>, allows selection of the abbreviated
  32. state name from a pick list created with TPPICK.
  33. ;                 ^-- this attribute used for general purpose emphasis
  34.  
  35. The contents of the field are validated in two ways. First, the
  36. picture mask, 'AA', insures that only upper-case alphabetic
  37. characters may be entered by the user. Second, a special
  38. validation routine, ValidateNotPartial, is used to insure that
  39. the field is either completely empty or completely full.
  40. ;
  41. !TOPIC  5 Zip code field
  42. This field receives special treatment to insure that it is either
  43. entirely blank or else contains a 5- or 9-digit number. Validation
  44. is performed in two ways. First, the picture mask, '99999-9999',
  45. insures that only digits (0-9) or spaces may be entered. Second, a
  46. user-written validation routine, ValidateZip, insures that none
  47. of the first five slots is empty unless the whole field is empty,
  48. and that none of the last four slots is empty unless all four are
  49. empty. If you examine ENTRY.PAS, you'll see that ValidateZip
  50. is a simple routine that relies on the built-in
  51. ValidateSubfields procedure.
  52. ;                 ^--- this attribute used for field/procedure/unit names
  53. ;
  54. !TOPIC  6 Phones field
  55. This field is unusual in that it has a nested data entry screen
  56. associated with it. If you move the cursor to this field and press
  57. <Enter>, the demo program pops up a window containing a secondary
  58. edit screen with two fields on it, 16Work phone and 17Home
  59. phone. This field was added to the main entry screen using the
  60. AddNestedField procedure.
  61. ;
  62. !TOPIC  7 Gender field
  63. ;                      v--- ^D signals link to topic 23
  64. This is one of the two 23multiple choice fields in the program,
  65. and it is the more typical of the two. The person's gender is
  66. stored in a variable of an enumerated type--GenderType =
  67. (Unknown, Male, Female)--and the user simply presses keys until
  68. the desired choice is displayed. To see how this is done, examine
  69. the IncChoice routine in ENTRY.PAS.
  70. ;
  71. !TOPIC  8 Marital status field
  72. This field is a standard yes/no field, added by calling
  73. AddYesNoField, and as such it requires no special validation.
  74. The only valid entries are `Y' or `N', and input is automatically
  75. converted to upper case.
  76. ;
  77. !TOPIC  9 Date of birth field
  78. This is a Date field and can hold any valid date between January
  79. 1, 1900 and December 31, 2078. Validation is done in two ways.
  80. First, the picture mask, usually 'mm/dd/yy', insures that only
  81. digits (0-9) or spaces may be entered. Second, a built-in
  82. validation routine insures that (almost) any date entered is a
  83. legal one. The only illegal date that may be entered,
  84. '00/00/00', is allowed because the lower and upper bounds for
  85. the field are both 0. To force the entry of a legal date, the
  86. constants MinDate and MaxDate (declared in TPDATE) could
  87. be used instead. Notice that the 10Age field is calculated
  88. based on the date of birth.
  89. ;
  90. !TOPIC 10 Age field
  91. This is a protected field, meaning that its value cannot be
  92. altered directly by the user. It is also a calculated field,
  93. meaning that its value is determined automatically based on that
  94. of another field, in this case the 9Date of birth field. To
  95. see how this is done, examine the UpdateHandler routine in
  96. ENTRY.PAS. Like the other protected fields in ENTRY, the Age
  97. field is displayed in a different color than unprotected fields.
  98. ;
  99. !TOPIC 11 Hourly wage field
  100. This is the only numeric field in the program, at least by the
  101. definition used in TPENTRY. That is, it is the only field that
  102. uses the 22numeric editor, which is requested by calling
  103. SetNumeric(On). Although the most noticeable difference between
  104. it and most of the other fields is that text is inserted from
  105. right to left in calculator fashion, the command set for the
  106. numeric editor is also restricted.
  107.  
  108. Notice, too, that the value in this field is used, along with
  109. 13Hours worked per week, to calculate 12Weekly earnings and
  110. 14Yearly earnings.
  111. ;
  112. !TOPIC 12 Weekly earnings field
  113. This is a protected field, meaning that its value cannot be
  114. altered directly by the user. It is also a calculated field,
  115. meaning that its value is determined automatically based on that
  116. of another field, in this case the 11Hourly wage and 13Hours
  117. worked per week fields. To see how this is done, examine the
  118. UpdateHandler routine in ENTRY.PAS. This field is automatically
  119. right-justified because its picture mask contains a fixed decimal
  120. point, and it is padded with asterisks rather than spaces, an option
  121. selected using SetPadChar('*').
  122. ;
  123. !TOPIC 13 Hours worked per week field
  124. This is the second of the two 23multiple choice fields in the
  125. program. Unlike the 7Gender field, however, it does not present
  126. the user with a small set of choices corresponding to an
  127. enumerated type. Rather, it presents a default value that can be
  128. incremented or decremented by pressing the <+> or <-> keys. To
  129. see how this is done, examine the IncChoice routine in
  130. ENTRY.PAS.
  131.  
  132. Notice, too, that the value in this field is used, along with
  133. 11Hourly wage, to calculate 12Weekly earnings and 14Yearly
  134. earnings.
  135. ;
  136. !TOPIC 14 Yearly earnings field
  137. This field is handled in precisely the same manner as the
  138. 12Weekly earnings field.
  139. ;
  140. !TOPIC 15 Notes field
  141. This is a memo field created with the routines in TPMEMO. Like
  142. the 6Phones field, the Notes field is displayed by itself in a
  143. popup window when you move the cursor to it and press <Enter>.
  144.  
  145. The memo field editor provides a variety of commands for editing
  146. text, moving the cursor, reformatting text, and so on. Like
  147. TPENTRY, TPMEMO also provides plenty of hooks to allow the
  148. unit to be customized for a particular application. ENTRY uses
  149. one of these hooks, MemoStatusPtr, to display a customized
  150. status line at the bottom of the editing window, for example.
  151. !PAGE
  152. ;   ^----------- force the start of a new screen
  153. The memo field editor offers the following commands:
  154.  
  155.   <Left>, <CtrlS>
  156.   Cursor left one character.
  157.  
  158.   <Right>, <CtrlD>
  159.   Cursor right one character.
  160.  
  161.   <CtrlLeft>, <CtrlA>
  162.   Cursor left one word. A 'word' is a series of non-blank
  163.   characters followed by one or more blanks.
  164. !PAGE
  165.   <CtrlRight>, <CtrlF>
  166.   Cursor right one word.
  167.  
  168.   <Home>, <CtrlQ><S>
  169.   Cursor to beginning of line.
  170.  
  171.   <End>, <CtrlQ><D>
  172.   Cursor to end of line.
  173.  
  174.   <Up>, <CtrlE>
  175.   Cursor up one line.
  176. !PAGE
  177.   <Down>, <CtrlX>
  178.   Cursor down one line.
  179.  
  180.   <CtrlW>
  181.   Scroll display up one line.
  182.  
  183.   <CtrlZ>
  184.   Scroll display down one line.
  185.  
  186.   <PgUp>, <CtrlR>
  187.   Scroll display up one page.
  188. !PAGE
  189.   <PgDn>, <CtrlC>
  190.   Scroll display down one page.
  191.  
  192.   <CtrlHome>, <CtrlQ><E>
  193.   Move cursor to top of edit window.
  194.  
  195.   <CtrlEnd>, <CtrlQ><X>
  196.   Move cursor to bottom of edit window.
  197.  
  198.   <CtrlPgUp>, <CtrlQ><R>
  199.   Move cursor to beginning of file.
  200. !PAGE
  201.   <CtrlPgDn>, <CtrlQ><C>
  202.   Move cursor to end of file.
  203.  
  204.   <ClickLeft>
  205.   Move the cursor to the position indicated by the mouse.
  206.  
  207.   <Del>, <CtrlG>
  208.   Delete character at cursor.
  209.  
  210.   <Bksp>, <CtrlH>, <CtrlBksp>
  211.   Delete character to left of cursor.
  212. !PAGE
  213.   <CtrlY>
  214.   Delete current line.
  215.  
  216.   <CtrlQ><Y>
  217.   Delete from cursor to end of line.
  218.  
  219.   <CtrlT>
  220.   Delete word to right of cursor.
  221.  
  222.   <Enter>, <CtrlM>
  223.   Start a new line.
  224. !PAGE
  225.   <Tab>, <CtrlI>
  226.   Move the cursor to the next tab stop.
  227.  
  228.   <CtrlP>
  229.   Insert control character. For example, to insert a ^G, you
  230.   would enter <CtrlP><CtrlG>.
  231.  
  232.   <Ins>
  233.   Toggle insert mode on and off. Fat cursor indicates insert
  234.   mode; thin cursor indicates overtype mode.
  235. !PAGE
  236.   <CtrlO><W>
  237.   Toggle word wrap on and off. When word wrap is on, any
  238.   attempt to insert or append text beyond the right margin
  239.   will cause a new line to be inserted, and the word
  240.   currently being entered to be moved to the new line.
  241.  
  242.   <CtrlO><I>
  243.   Toggle auto-indent mode. In auto-indent mode, pressing 
  244.   <Enter> in insert mode causes the new line to have the same
  245.   indentation as the previous line. Auto-indent also affects
  246.   the way that text is formatted when word wrap occurs.
  247. !PAGE
  248.   <CtrlB>
  249.   Reformat the current paragraph.
  250.  
  251.   <AltR>
  252.   Reformat the entire file. Use this command with caution.
  253.  
  254.   <CtrlQ><L>
  255.   Restore original contents of the field and continue editing.
  256.  
  257.   <Esc>, <CtrlBreak>, <ClickRight>
  258.   Quit editing.
  259. !PAGE
  260.   <F1>, <ClickBoth>
  261.   Help. If a user-written help routine has been established,
  262.   as has been done here, this command invokes that routine.
  263.   Otherwise it does nothing.
  264. ;
  265. !TOPIC 16 Work phone field
  266. This field receives special treatment to insure that it is either
  267. entirely blank or else contains a complete phone number, with or
  268. without an area code. Validation is performed in two ways. First,
  269. the picture mask, '(999) 999-9999', insures that only digits (0-9)
  270. or spaces may be entered. Second, a user-written validation
  271. routine, ValidatePhone, insures that none of the last seven
  272. slots is empty unless the whole field is empty, and that none of
  273. the first three slots is empty unless all three are empty. If you
  274. examine ENTRY.PAS, you'll see that ValidatePhone is a simple
  275. routine that relies on the built-in ValidateSubfields procedure.
  276. !PAGE
  277. Notice that each sub-field is padded to the right with underscore
  278. characters. This option was selected using SetPadChar('_'). The
  279. underscore characters appear only on screen; the string being
  280. edited is actually padded with spaces.
  281. ;
  282. !TOPIC 17 Home phone field
  283. This field is handled in precisely the same manner as the 16Work
  284. phone field.
  285. ;
  286. ; The remaining topics are more general...
  287. ;
  288. !TOPIC 18 Help on Help
  289. ;      v----- force this topic to appear first in the index
  290. !INDEX 1
  291. The demo program has a context-sensitive help system developed
  292. using TPHELP. As you've already discovered, this help system is
  293. similar to the one used by Borland in Turbo Pascal: it is
  294. invoked by pressing <F1>, you can select from an index of help
  295. topics by pressing <F1> a second time, and you can page backward
  296. through a list of previously selected topics by pressing
  297. <AltF1>.
  298.  
  299. The text for a given topic may also contain links to other topics,
  300. which can be selected by moving the cursor to the appropriate word
  301. or phrase and pressing <Enter>.
  302. ;
  303. !TOPIC 19 Editing commands
  304. !INDEX 2
  305. The following are the commands available in the string editor,
  306. which is used for editing most of the fields in the demo program.
  307. Note that several of these commands are either not available or
  308. behave slightly differently in the 22numeric editor and
  309. 23multiple choice editor.
  310.  
  311.   <Left>, <CtrlS>
  312.   Cursor left one character.
  313.  
  314.   <Right>, <CtrlD>
  315.   Cursor right one character.
  316.  
  317.   <CtrlLeft>, <CtrlA>
  318.   Cursor left one word. A 'word' is a series of non-blank
  319.   characters followed by one or more blanks.
  320.  
  321.   <CtrlRight>, <CtrlF>
  322.   Cursor right one word.
  323.  
  324.   <Home>, <CtrlQ><S>
  325.   Cursor to beginning of field.
  326.  
  327.   <End>, <CtrlQ><D>
  328.   Cursor to end of field.
  329.  
  330.   <Del>, <CtrlG>
  331.   Delete character at cursor.
  332.  
  333.   <Bksp>, <CtrlH>, <CtrlBksp>
  334.   Delete character to left of cursor.
  335.  
  336.   <CtrlY>
  337.   Clear entire field.
  338.  
  339.   <CtrlEnd>, <CtrlQ><Y>
  340.   Delete from cursor to end of subfield.
  341.  
  342.   <CtrlHome>
  343.   Delete from beginning of subfield to cursor.
  344.  
  345.   <CtrlT>
  346.   Delete word to right of cursor.
  347. !PAGE
  348.   <Ins>
  349.   Toggle insert mode on and off. Fat cursor indicates insert
  350.   mode; thin cursor indicates overtype mode.
  351.  
  352.   <CtrlP>
  353.   Insert control character. For example, to insert a ^G, you
  354.   would enter <CtrlP><CtrlG>.
  355.  
  356.   <CtrlR>, <CtrlQ><L>
  357.   Restore original contents of the field and continue editing.
  358.  
  359.   <F1>
  360.   Help. If a user-written help routine has been established,
  361.   as has been done here, this command invokes that routine.
  362.   Otherwise it does nothing.
  363. ;
  364. !TOPIC 20 Field movement commands
  365. !INDEX 3
  366. These commands allow the user to move the cursor from one field
  367. (or subfield) to another:
  368.  
  369.   <Enter>, <CtrlM>
  370.   Accept contents of field and move to the next one.
  371.  
  372.   <Tab>, <CtrlI>
  373.   Move cursor to the beginning of the next subfield.
  374.  
  375.   <ShiftTab>
  376.   Move cursor to the beginning of the previous subfield.
  377. !PAGE
  378.   <Up>, <CtrlE>
  379.   Move cursor to last field above the current one.
  380.  
  381.   <Down>, <CtrlX>
  382.   Move cursor to last field below the current one.
  383.  
  384.   <CtrlPgUp>, <CtrlQ><R>
  385.   Move cursor to first field on screen.
  386.  
  387.   <CtrlPgDn>, <CtrlQ><C>
  388.   Move cursor to last field on screen.
  389. ;
  390. !TOPIC 21 Exit commands
  391. !INDEX 4
  392. An exit command is a command that causes control to pass from the
  393. entry screen manager back to the main program, which must react
  394. to the command. The following are the standard exit commands:
  395.  
  396.   <CtrlEnter>, <CtrlK><D>, <CtrlK><Q>
  397.   Quit editing. Accepts all changes to the current field.
  398.  
  399.   <Esc>, <CtrlBreak>
  400.   Abort. Restores the original value of the current field.
  401.  
  402.   <PgUp>
  403.   Quit editing the current record and start editing the
  404.   previous one. Accepts all changes to the current field.
  405.  
  406.   <PgDn>
  407.   Quit editing the current record and start editing the
  408.   next one. Accepts all changes to the current field.
  409.  
  410. The programmer may also define as many as ten additional exit
  411. commands: ESuser0..ESuser9. In the demonstration program,
  412. there are two user-defined exit commands:
  413. !PAGE
  414.   <AltB>
  415.   Toggles the error bell on and off.
  416.  
  417.   <F2>
  418.   Displays a pick list of abbreviated 4state names for the user
  419.   to choose from.
  420. ;
  421. !TOPIC 22 Numeric editor
  422. !INDEX 5
  423. The numeric editor is designed exclusively for entering and
  424. editing numbers. It works just like a calculator, meaning that the
  425. cursor is always positioned at the far right edge of the field and
  426. digits are always inserted at the end, pushing previously entered
  427. digits to the left.
  428.  
  429. The numeric editor also has one command not found in the 19string
  430. editor or the 23multiple choice editor:
  431.  
  432.   <->
  433.   Changes the sign of the number being entered.
  434. ;
  435. !TOPIC 23 Multiple choice editor
  436. !INDEX 6
  437. This special-purpose editor is designed to edit two kinds of
  438. fields: those associated with enumerated types, and those
  439. associated with numeric values that need to be adjusted in
  440. incremental fashion.
  441.  
  442. In comparison with the 19string editor, the multiple choice editor
  443. offers a restricted command set. There are no commands for
  444. inserting or deleting text, nor are there any commands for moving
  445. the cursor within the field itself. The only cursor commands
  446. available are those which move the cursor to another field.
  447. !PAGE
  448. The multiple choice editor does, however, offer two commands not
  449. implemented in the 19string editor or the 22numeric editor:
  450.  
  451.   <+>, <Space>
  452.   Select next choice, or increment value.
  453.  
  454.   <->
  455.   Select previous choice, or decrement value.
  456.  
  457. Note that you may alter these key assignments in the same
  458. ways that you would for any other commands.
  459. ;
  460. !TOPIC 24 Mouse functions
  461. !INDEX 7
  462. Thanks to the low-level facilities provided by TPMOUSE and several
  463. other units in Turbo Professional, ENTRY is able to provide
  464. extensive mouse support. While editing fields, you can do the
  465. following things using a mouse (if one is installed):
  466.  
  467. - Move the mouse cursor (shaped like a diamond) to any
  468.   unprotected field on the data entry screen and select it by
  469.   clicking the left mouse button
  470. !LINE
  471. - Move the mouse cursor to the 6Phones field and click the left
  472.   mouse button: the secondary entry screen associated with it
  473.   will be popped up
  474. !LINE
  475. - Move the mouse cursor to the 4State field and click the left
  476.   mouse button once to select it, a second time to pop up the
  477.   pick list of state names
  478. !LINE
  479. - Move the mouse cursor to the 8Marital status field and click
  480.   the left mouse button once to select it, a second time to
  481.   toggle the value
  482. !LINE
  483. - Move the mouse cursor to the 13Hours worked per week or
  484.   7Gender field and click the left mouse button once to select
  485.   the field, a second time to increment the value
  486. !LINE
  487. - Press the right mouse button to simulate pressing the <Esc>
  488.   key
  489. !LINE
  490. - Press both mouse buttons (the left and the right) to bring
  491.   up the help screen for the current field
  492. !LINE
  493. - Press the center mouse button (on three-button mice only) to
  494.   simulate pressing <Enter>
  495.  
  496. You can also use the mouse when selecting from pick lists,
  497. when using the help system, and when responding to prompts for
  498. a single keypress (in general, clicking the right button does
  499. the same thing as pressing <Esc>, while clicking the left
  500. button does the same thing as pressing <Enter>).
  501.